/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.PA165.musiclibraryapi.services;

import cz.muni.fi.PA165.musiclibraryapi.dto.AuthorDTOInterface;
import java.util.List;

/**
 * This service allows to manipulate with authors on service layer.
 *
 * @author Dominik
 */
public interface AuthorService {
     
    /**
     * Stores new author into database. Id for the new author is automatically
     * generated and stored into id attribute.
     * 
     * @param author author to be created.
     * @throws DataAccessException something goes wrong.
     */ 
    public void createAuthor(AuthorDTOInterface author);
     
    /**
     * Returns author with given id.
     * 
     * @param id primary key of requested author.
     * @return author with given id or null if author does not exist.
     * @throws DataAccessException something goes wrong.
     */  
    public AuthorDTOInterface getAuthor(Long id);
    
    /**
     * Returns list of all authors in the database.
     * 
     * @return list of all authors in database.
     * @throws DataAccessException something goes wrong.
     */
    public List<AuthorDTOInterface> getAllAuthors();
    
    /**
     * Updates author in database.
     * 
     * @param author updated author to be stored into database.
     * @throws DataAccessException something goes wrong.
     */   
    public void updateAuthor(AuthorDTOInterface author);
     
    /**
     * Deletes author from database. 
     * 
     * @param author author to be deleted from db.
     * @throws DataAccessException something goes wrong.
     */ 
    public void deleteAuthor(AuthorDTOInterface author);
    
}
